#include "matrix.cpp"
#include "model.hpp"
#include "arcball.hpp"
#include "window.hpp"
#include <iostream>

using namespace std;

void testMatrix(){
	Matrix<double> m1,m2,m3;

	m1 = Matrix<double>(4,4);
	m2 = Matrix<double>(4,4);

	m1[0][0] = 1;
	m1[0][1] = 2;
	m1[0][2] = 3;

	m1[1][0] = 4;
	m1[1][1] = 5;
	m1[1][2] = 6;

	m1[2][0] = 7;
	m1[2][1] = 8;
	m1[2][2] = 9;
	m1.print();

	for(unsigned i=0;i<3;i++){
		for(unsigned j=0;j<3;j++){
			m2[i][j] = 1;
		}
	}
	m2.print();

	m3 = m2 * m1;
	m3.print();
}

void testModel(){
vector<double> c;
	model *m = model::importFromFile("./data/cube.txt");

	cout<<"Affichage"<<endl;
	m->print();

	cout<<"Suppression"<<endl;
	delete m;
}


void testModeleT(){
vector<double> c;
	modelTextured *mt = modelTextured::importFromFile("./data/head.txt");

	cout<<"Affichage"<<endl;
	mt->print();

	cout<<"Suppression"<<endl;
	delete mt;
}

void testArcBall(){/*
	vector<int> c;
	model *mt = model::importFromFile("./data/cube.txt");
	arcball *ab = new arcball(c, 10., mt);


	cout<<"Action 1"<<endl;
	ab->mousePressed(0,0);
	cout<<"Action 2"<<endl;
	ab->mouseDragged(10,0);

	cout<<"Affichage"<<endl;
	mt->print();

	cout<<"Suppression"<<endl;
	delete ab;
	delete mt;*/
}

void testWindow(){

	cout<<"Initialisation"<<endl;
	init();

	cout<<"Lancement"<<endl;
	launch(0,NULL);

	cout<<"Destruction"<<endl;
	destroy();

	cout<<"Fin de test Window"<<endl;
}

int main(){

	//testMatrix();
	//testModel();
	//testModeleT();
	//testArcBall();
	testWindow();

	return 0;
}
